home *** CD-ROM | disk | FTP | other *** search
/ Pascal Super Library / Pascal Super Library (CW International)(1997).bin / LIBRARY / SWDOS12 / DOSALLOC.ASM < prev    next >
Assembly Source File  |  1994-07-28  |  1KB  |  44 lines

  1. ;******************************************************************
  2. ;*                          DOSALLOC.ASM                          *
  3. ;*          Source file for SoftWeyr enhanced DOS toolbox         *
  4. ;*                           version 1.0                          *
  5. ;*                 Copyright (c) by SoftWeyr,1994                 *
  6. ;******************************************************************
  7. MODEL TPascal
  8. LOCALS
  9. .DATA
  10.      EXTRN DosError :word
  11. .CODE
  12.         PubLic DosAlloc
  13. DosAlloc  Proc Far Sz:Dword
  14.           LES SI,Sz
  15.           Mov BX,ES:[SI]
  16.           Add Bx,15
  17.           Mov Cl,4
  18.           Shr BX,CL
  19.           Mov DX,ES:[SI+2]
  20.           MOV DX,12
  21.           Shl DX,CL
  22.           Add BX,DX
  23.           Mov AH,48H
  24.           Int 21H
  25.           Pushf
  26.           Sub DX,Dx
  27.           Mov DL,BH
  28.           Mov CL,4
  29.           Shr DX,CL
  30.           Mov ES:[Si]+2,DX
  31.           Shl BX,CL
  32.           Mov ES:[SI],bX
  33.           Sub DX,DX
  34.           Popf
  35.           Jc @@Error
  36.           XCHG AX,DX
  37. @@Error:  Mov DosError,AX
  38.           SUB AX,AX
  39.           Ret
  40.          EndP
  41. END
  42.  
  43.  
  44.